<!--  -->
<template>
  <div>
    <div class="user">
      <el-table 
      :data="comments"
      border
      stripe
      height="600"
      >
        <el-table-column type="index" label="序号"> </el-table-column>
        <el-table-column prop="id" label="ID"></el-table-column>
        <el-table-column prop="name" label="用户名"></el-table-column>
        <el-table-column prop="phone" label="手机号"></el-table-column>
        <el-table-column prop="content" label="评论内容"></el-table-column>
        <el-table-column label="操作">delete</el-table-column>
      </el-table>
      <el-pagination></el-pagination>
    </div>
  </div>
</template>

<script>
import { getAllComment } from "@/api/comments";
export default {
  name: "",
  props: [""],
  data() {
    return {
      comments: null,
    };
  },
  components: {},
  computed: {},
  created() {
      getAllComment().then(res=>{
          if(res.code===20000){
              this.comments = res.data.comments
          }else{
              alert("获取数据失败")
          }
      })
  },
  beforeMount() {},
  mounted() {},
  methods: {},
  watch: {},
};
</script>

<style lang='css' scoped>
.user {
  margin: 15px;
}
</style>